package com.ulc.app;

import android.os.Bundle;
import android.view.KeyEvent;
import android.widget.Toast;

import com.getcapacitor.BridgeActivity;
import com.getcapacitor.Plugin;

import java.util.ArrayList;

public class MainActivity extends BridgeActivity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Initializes the Bridge
    this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
      // Additional plugins you've installed go here
      // Ex: add(TotallyAwesomePlugin.class);
    }});
  }

  //点击两次退出APP
  //第一次点击事件发生的时间
//  private long mExitTime;

  //点击两次返回退出app   System.currentTimeMillis()系统当前时间
//  public boolean onKeyDown(int keyCode, KeyEvent event) {
//    if (keyCode == KeyEvent.KEYCODE_BACK) {
//      if ((System.currentTimeMillis() - mExitTime) > 2000) {
//        Object mHelperUtils;
//        Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
//        mExitTime = System.currentTimeMillis();
//
//      } else {
//        finish();
//      }
//      return true;
//    }
//    return super.onKeyDown(keyCode, event);
//  }
}
